package com.teach.demo01;

import java.util.Scanner;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-06 14:07
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
/*
extends  Ellipse  不能基础被final修改的类
 */
public class Roundness extends  AbstractShape {

  /**
   * 常量
   * 命名规则 ^[A-Z][A-Z0-9_]*$
   */


  private float b;

  @Override
  public void input() {
    String name;
//    PI = 3.14f;//不可修改
    Scanner scanner = new Scanner(System.in);
    System.out.println("输入圆的半径");
    b = scanner.nextFloat();
//    super.area = Math.PI * b*b;
//    super.perimeter = Math.PI * b * 2;
  }

  @Override
  public double getArea() {
    return PI * b*b;
  }

  /**
   * 用final修改的方法是不能重写的
   */
//  @Override
//  public double getPerimeter() {
//    return Math.PI * b * 2;
//  }
}
